449f95ac740413c6cc901ac80dc532d6bfc989fe,genie-web/src/main/java/com/netflix/genie/web/tasks/leader/ClusterCheckerTask.java,ClusterCheckerTask,run,#,110

Before Change


        // Find any hosts that are now healthy since last iteration
        // Two loops to avoid concurrent modification exception
        final Set<String> toRemove = this.errorCounts.keySet()
            .stream()
            .filter(host -> !badNodes.contains(host))
            .collect(Collectors.toSet());
        toRemove.forEach(this.errorCounts::remove);

        // Did we pass bad threshold on any hosts? Error jobs if so

After Change


            .filter(host -> !this.hostName.equals(host))
            .forEach(this::validateHostAndUpdateErrorCount);

        this.errorCounts.entrySet().removeIf(entry -> {
            final String host = entry.getKey();
            boolean result = true;
            if (entry.getValue() >= properties.getLostThreshold()) {
                try {
                    updateJobsToFailedOnHost(host);
                } catch (Exception e) {
                    log.error("Unable to update jobs on host {} due to exception", host, e);
                    unableToUpdateJobCounter.increment();
                    result = false;
                }
            } else {
                result = false;
            }
            return result;
        });
        log.info("Finished checking for cluster node health.");
    }